//
//  ASPublicDefine.h
//
//  Created by apple on 14-9-11.
//  Copyright (c) 2014年. All rights reserved.
//

#ifndef AS_PUBLICDEFINE_H
#define AS_PUBLICDEFINE_H

#import "ASRefreshControl.h"
#import "ASRefreshView.h"



//版本
#define SYSTEM_VERSION ([[UIDevice currentDevice].systemVersion floatValue])
#define StatusbarSize ((SYSTEM_VERSION >= 7 && __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_6_1)?20.f:0.f)

#define iPhone6 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(750, 1334), [[UIScreen mainScreen] currentMode].size) : NO)

#define iPhone6Plus ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2208), [[UIScreen mainScreen] currentMode].size) : NO)
#define iS_iPhone6Plus ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2001), [[UIScreen mainScreen] currentMode].size) : NO)

#define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)

#define iPhone4 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960), [[UIScreen mainScreen] currentMode].size) : NO)

#define isRetina ([[UIScreen mainScreen] scale] > 1.0 ? YES : NO)


#define AS_APP_DELEGATE  ((ASAppDelegate*)[UIApplication sharedApplication].delegate)


//适用于RGB颜色相同的场景
#define RGBA(r,g,b,a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]
#define RGB(r,g,b) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1.0f]

// block self
#define WEAKSELF typeof(self) __weak weakSelf = self;
#define STRONGSELF typeof(weakSelf) __strong strongSelf = weakSelf;

//! lich 2014-11-04 add
#define isHighThanIphone4S ([UIApplication sharedApplication].keyWindow.bounds.size.height > 480 ? YES : NO)
#define isHighThanIphone5S ([UIApplication sharedApplication].keyWindow.bounds.size.height > 568 ? YES : NO)
#define recordTabEditViewTag 1215

#define AS_APP_UserCode (((ASAppDelegate *)[UIApplication sharedApplication].delegate).userCode)

#define AS_APP_UserTypeStu (((ASAppDelegate *)[UIApplication sharedApplication].delegate).bSelectStu)
#define AS_APP_UserType    (((ASAppDelegate *)[UIApplication sharedApplication].delegate).userSelectStatus)

#define kScreenSize [[UIScreen mainScreen] bounds].size




#endif


